package hu.mapro.flang.gwt.client;

import hu.mapro.flang.gwt.client.ui.UiBuilder;
import hu.mapro.flang.gwt.domain.client.AutoBeans.BookUiBuilder;
import hu.mapro.flang.gwt.domain.client.AutoBeans.ExerciseUiBuilder;
import hu.mapro.flang.gwt.domain.client.AutoBeans.UserUiBuilder;
import hu.mapro.gwtui.client.impl.DefaultUiBuilder;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class Application {

	UiBuilder uiBuilder;
	DefaultUiBuilder defaultUiBuilder;
	BookUiBuilder bookUiBuilder;
	UserUiBuilder userUiBuilder;
	ExerciseUiBuilder exerciseUiBuilder;
	
	void run() {
		uiBuilder.build();
		
		userUiBuilder.setMenuGroup(uiBuilder.getManageMenuGroup());
		userUiBuilder.build();
		bookUiBuilder.setMenuGroup(uiBuilder.getManageMenuGroup());
		bookUiBuilder.build();
		exerciseUiBuilder.setMenuGroup(uiBuilder.getManageMenuGroup());
		exerciseUiBuilder.build();
		
		defaultUiBuilder.build();
		defaultUiBuilder.display();
	}

	@Inject
	public Application(UiBuilder uiBuilder, DefaultUiBuilder defaultUiBuilder,
			BookUiBuilder bookUiBuilder, UserUiBuilder userUiBuilder,
			ExerciseUiBuilder exerciseUiBuilder) {
		super();
		this.uiBuilder = uiBuilder;
		this.defaultUiBuilder = defaultUiBuilder;
		this.bookUiBuilder = bookUiBuilder;
		this.userUiBuilder = userUiBuilder;
		this.exerciseUiBuilder = exerciseUiBuilder;
	}

	
	
	
}
